home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 November / CHIP Kasım 1997.iso / ARACLAR / TER500 / 500TER._XE / SCRIPT.EXE / BOXES.TSL < prev    next >
Encoding:
Text File  |  1995-08-12  |  3.3 KB  |  106 lines

  1. % -----------------------------------------------------------------------------
  2. % How to draw a BOX on screen                         *TERMINATE PRESCRIPTION*
  3. % -----------------------------------------------------------------------------
  4. %
  5. %  Version          : 1.00
  6. %  Filename         : BOXES.TSL
  7. %  Company          : BLOKKER+BLOKKER Software
  8. %  Programmer       : Joop Blokker
  9. %  Module created   : 09 Aug 1995
  10. %  Latest revision  : 09 Aug 1995
  11. %  Language/version : Terminate Prescription 1.00
  12. %  Remarks          : Step by step method, using variables.
  13. %
  14. % -----------------------------------------------------------------------------
  15. %
  16. % How to paint a Box on screen in 4 easy steps:
  17. %
  18. %             1 - Which box ?
  19. %             2 - Which color?
  20. %             3 - Where on screen?
  21. %             4 - Do it!
  22. %
  23. % ----------------------------- Which Box ? ------------------
  24. %
  25. % Box type 0 - No Border Lines
  26. % Box type 1 - Single Border Lines
  27. % Box type 2 - Double Border Lines
  28. % Box type 3 - Double Top & Bottom + Single Sides
  29. % Box type 4 - Double Sides + Single Top & Bottom
  30. % Box type 5 - Corners *, Sides |, Top & Bottom -.
  31. % Box type 6 - Single Top & Bottom Lines Only
  32. % Box type 7 - Double Top & Bottom Lines Only
  33.  
  34. Set BoxType = 3
  35.  
  36. % ----------------------------- Which color ? ----------------
  37. %
  38. % 0 = black   4 = red      8 = grey         12 = light red
  39. % 1 = blue    5 = magenta  9 = light blue   13 = light magenta
  40. % 2 = green   6 = brown   10 = light green  14 = yellow
  41. % 3 = cyan    7 = white   11 = light cyan   15 = bright white
  42. %
  43. Set Foreground = 15        % Foreground color: Bright white
  44. Set BackGround = 4         % Background color: Red
  45.  
  46. % Calculate color attribute:
  47. %
  48. Set ColorAttr = ForeGround + ( BackGround * 16)
  49.  
  50. % ------------------------------ Where ? ---------------------
  51. % Now define coordinates on screen
  52. %
  53. Set TopLeftCol    = 20       % Top Left Column
  54. Set TopLeftRow    =  5       % Top Left Row
  55. Set LowerRightCol = 60       % Lower Right Column
  56. Set LowerRightRow = 15       % Lower Right Row
  57.  
  58.  
  59. ClearScreen
  60. Set SaveColor = GetAttrXY(1,1)
  61. SetAttr 7
  62.  
  63. % ------------------------------ The Box ! -------------------
  64. %
  65. Box TopLeftCol, TopLeftRow, LowerRightCol, LowerRightRow, ColorAttr, BoxType
  66.  
  67.  
  68. WriteStr TopLeftCol+2, TopLeftRow+2, "The Box!"
  69. WriteStr 30,24,"Press Enter, please..."
  70. WaitEnter
  71.  
  72. % simply change the variables:
  73. %
  74. Set TopLeftCol    = TopLeftCol + 2
  75. Set TopLeftRow    = TopLeftRow + 2
  76. Set LowerRightCol = LowerRightCol + 2
  77. Set LowerRightRow = LowerRightRow + 2
  78.  
  79. Set BackGround = 1                                % Background Blue
  80. Set ColorAttr = ForeGround + ( BackGround * 16)   % recalculate attribute
  81.  
  82. % ------------------------------ Another Box!-----------------
  83. %
  84. Box TopLeftCol, TopLeftRow, LowerRightCol, LowerRightRow, ColorAttr, BoxType
  85.  
  86. WriteStr TopLeftCol+2, TopLeftRow+2, "Another Box!"
  87. WriteStr 30,24,"Press Enter, please..."
  88. WaitEnter
  89. SetAttr 7
  90. ClearScreen
  91.  
  92. % ------------------------------ Let's play ------------------
  93. %
  94. Set ColorAttr = 15 % White on black
  95. for x,1,9,1
  96.   Box x+20, x+1, x+50, x+11, ColorAttr+(x*16), 3
  97.   WriteStr x+29,x+1," Terminate! "
  98. next
  99. WriteStr 17,22," Try High Intensity On/Off in Alt-O Color Set-up "
  100. WriteStr 29,24," Press Enter, please... "
  101. WaitEnter
  102.  
  103. SetAttr = SaveColor
  104. ClearScreen
  105. TERMINATE
  106.